import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from "../components/login"
import Home from "../components/home"
import Users from "../components/users"
import Welcome from "../components/welcome"
const originalPush = VueRouter.prototype.push
   VueRouter.prototype.push = function push(location) {
   return originalPush.call(this, location).catch(err => err)
}

Vue.use(VueRouter)

const router = new VueRouter({
    routes: [
        { path: '/', redirect: '/login' },
        { path: '/login', component: Login },
        {
            path: '/home',
            component: Home,
            children: [

                
                { path: '/users', component: Users },
            ]
        },

    ]

})
export default router;
